package com.apes.fn.tms.repository;

import com.apes.fn.tms.model.Vehicle;
import com.apes.framework.jpa.repository.CustomRepository;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Page;
import org.springframework.data.jpa.repository.Query;


public interface VehicleRepository  extends CustomRepository<Vehicle, String> {

    @Query(value = "select * from tms_vehicle t where t.id not in(select c.vehicle_id from tms_chauffeur c where c.vehicle_id is not null)",nativeQuery = true)
    Page<Vehicle> findAllByNoIn( Pageable pageable);

    Vehicle findByVehicleNumber(String vehicleNumber);
}
